<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="css/index.css">
    <link rel="shortcut icon" href="img/favicon.png">
    <title>Document</title>
</head>

<body>
    <div id="app" class="container">
        <div class="home-header">
            <img src="img/home-search-text.png" alt="">
            <form action="">
                <input type="text" placeholder="搜索职位/公司">
                <button>搜索</button>
            </form>
            <a href="javascript:;">
                <div class="chat">
                    <div class="chat-icon">
                        <img src="img/chat.png" alt="">
                    </div>
                    <div class="chat-wrap">
                        <span>消息</span>
                    </div>
                </div>
            </a>
        </div>

        <div class="home-categories">
            <dl v-cloak v-for="(item,index) in categories">
                <dt>
                    <img :src="item.icon" alt="">
                    <p>{{item.name}}</p>
                </dt>
                <dd>
                    <a :href="item.href" class="tag" v-for="tag in item.tags">{{tag}}</a>
                </dd>
            </dl>
        </div>

        <div class="home-footer">
            <p>违法和不良信息举报邮箱：jubao@kanzhun.com</p>
            <p>企业服务热线和举报投诉：400 065 5799</p>
            <p>人力资源服务许可证</p>
            <p>网上有害信息举报专区</p>
        </div>
    </div>

    <script src="js/vue.js"></script>
    <script>
        const vm = new Vue({
            el: '#app',
            data: {
                categories: []
            },
            created: function () {
                const that = this
                fetch('http://127.0.0.1:5500/api/index.json')
                    .then(function (res) {
                        return res.json();
                    })
                    .then(function (data) {
                        vm.categories = data
                    })
            }
        })
    </script>
</body>

</html>